package com.example.test_1_24_springmvctest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("calc")
@RestController
public class CalcController {
    @RequestMapping("/sum")
    public String sum(Integer num1, Integer num2){
        System.out.println("asdasdasd");
        Integer sum = num1+num2;
        return "计算结果为: "+sum;
        // 前端的name参数数据,要刚好和这里面的参数数据保持一致
    }
}
